#!/usr/bin/env python
"""Dump all parameters, to match up with our rosbag files.
"""
from datetime import datetime
import json
import os.path
import rospy

FILENAME_BASE = "~/sailing-robot/params-dump_{}_{}.json"

params = rospy.get_param('/')

filename = FILENAME_BASE.format(params.get('log_name', ''),
                datetime.now().strftime('%Y-%m-%dT%H.%M.%S'))
filename = os.path.expanduser(filename)

with open(filename, 'w') as f:
    json.dump(params, f, indent=2)
